from . import home_bp  # ✅ 从当前包导入蓝图
from flask import request, render_template
from .controller.Index import Index


@home_bp.route('')
@home_bp.route('/')
def index():
    target_url = request.args.get('url')
    wait_time = request.args.get('time')
    html_content = Index().get_html_conntent(target_url, wait_time)
    # return ResponseUtil.success({"content": html_content})

    # print(content)
    data = {
        'content': html_content,
    }
    return render_template('home/index.html', **data)  # 模板路径：apps/home/templates/index.html


@home_bp.route('/about')
def about():
    data = {
        'content': 666,
    }
    # return "Home About Page"
    return render_template('home/index.html', **data)  # 模板路径：apps/home/templates/index.html